package com.junlinpro;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableAsync;

import com.junlinpro.tcp.TcpServer;
import com.junlinpro.udp.UdpServer;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@SpringBootApplication
@EnableAsync
public class SoundCollectorApplication {

	public static void main(String[] args) {
		SpringApplication.run(SoundCollectorApplication.class, args);

        new Thread(new Runnable() {
            @Override
            public void run() {
                TcpServer tcpServer = new TcpServer();
                try {
                    tcpServer.run(5002);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }).start();

        new Thread(new Runnable() {
            @Override
            public void run() {
                UdpServer udpServer = new UdpServer();
                udpServer.run(5003);
            }
        }).start();
        log.info("--- Collect服务端启动成功 ---");
    }

}
